home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 18073 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.3 KB

  1. Path: newshost.an-teallach.com!cch
  2. From: cch@an-teallach.com (Conrad Chin)
  3. Newsgroups: comp.lang.smalltalk,comp.object,comp.lang.c++,comp.lang.java
  4. Subject: Re: The Good, the Bad, the Ugly, and the Wicked ...
  5. Date: 16 Apr 1996 10:05:04 GMT
  6. Organization: An Teallach Ltd    
  7. Distribution: world
  8. Message-ID: <CCH.96Apr16110504@suilven.an-teallach.com>
  9. References: <31570B8E.5A12@vmark.com> <4je5rq$7qg@mimas.brunel.ac.uk>
  10.     <4jes0t$gth@decaxp.HARVARD.EDU> <31630E30.5A02@oma.com>
  11.     <4kbq3q$1i8@gaia.ns.utk.edu> <JSA.96Apr9131057@organon.com>
  12.     <RMARTIN.96Apr10133335@rcm.oma.com> <JSA.96Apr11153135@organon.com>
  13.     <4klt0j$i0m@sunsystem5.informatik.tu-muenchen.de>
  14. NNTP-Posting-Host: suilven.an-teallach.com
  15. In-reply-to: schuenem@informatik.tu-muenchen.de's message of 12 Apr 1996 15:31:31 GMT
  16.  
  17.  
  18. In article <4klt0j$i0m@sunsystem5.informatik.tu-muenchen.de> schuenem@informatik.tu-muenchen.de (Ulf Schuenemann) writes:
  19.  
  20. > From: schuenem@informatik.tu-muenchen.de (Ulf Schuenemann)
  21. > Newsgroups: comp.lang.smalltalk,comp.object,comp.lang.c++,comp.lang.java
  22. > Date: 12 Apr 1996 15:31:31 GMT
  23. > Organization: Technische Universitaet Muenchen, Germany
  24. > [**] This is intended to be an information post.
  25. > To the discussion Smalltalk vs C++ let me focus on the point
  26. > of two classes of errors that may occure:
  27. > a) access to illegal memory    (here: released memory)
  28. > b) calling illegal methods
  29. > A language has three main choices what to do:
  30. > #1 prohibit such errors
  31. > #2 catch such errors and report them (some kind of exception mechanism)
  32. > #3 don't bother - ie undefined behavior
  33. > I count the catching of illegal memory access by the operating system
  34. > (which, in unix, results in core dump) as #3.
  35. > Means to achieve this:
  36. >         a) access to illegal memory    b) calling illegal methods
  37. > --------------------------------------------------------------------------
  38. > #1 prohibit:    GC-systems            static typecheck
  39. > #2 catch:    bounds-checkers            "Message not understood"
  40. > #3 don't:    -                -
  41.  
  42. [classification of Smalltalk and C++ deleted]
  43.  
  44. I think we can add something for static type systems: they catch more
  45. than just "illegal" message sends -- they also catch "inappropriate"
  46. message sends. 
  47.  
  48. By "inappropriate" I mean a message send using the wrong selector or
  49. the wrong object, but where the object just happens to implement
  50. the message.
  51.  
  52. Some people have expressed that the lack of static typing is not a
  53. major problem because type errors soon become evident at testing time.
  54. However, "inappropriate" message sends as I've described do not
  55. necessarily manifest as RT errors.  Therefore they appear to be far
  56. more insidious, having the potential to lurk unnoticed in code for a
  57. long time.
  58.  
  59. I have used Smalltalk for implementing programs consisting mainly of
  60. user interface code (a task for which I find it very well suited).  In
  61. this scenario the lack of static typing doesn't seem to be a problem
  62. because errors are usually visually evident very quickly, even if they
  63. don't produce RT errors.
  64.  
  65. However, I'm more skeptical as to whether I would want to implement
  66. more abstract code in Smalltalk (eg, a compiler or a simulation
  67. system), where it seems that the potential for hidden errors is much
  68. larger. 
  69.  
  70. Comments, anyone ?
  71.  
  72. Conrad Chin
  73. --
  74. Conrad Chin (cch@an-teallach.com)        Tel: +44 131 662 0366
  75. An Teallach Limited                     +44 131 668 1550 x211
  76.